import request from '@/utils/request'

//获取首页数据
export const reqHomeInfo = ()=>request({
  url:`https://m.you.163.com/xhr/index.json?__timestamp=${Math.random()}`
})

//获取分类详情数据
export const reqCategory = ()=>request({
  url:`https://m.you.163.com/item/cateList.json?__timestamp=${Math.random()}`
})

//获取分类详情数据
export const reqCategoryInfo = (categoryId:any)=>request({
  url:`https://m.you.163.com/item/cateList.json?__timestamp=${Math.random()}&categoryId=${categoryId}`
})

//获取值得买轮播数据
export const reqBuyBanner = ()=>request({
  url:'https://m.you.163.com/topic/v1/know/navWap.json'
})

//获取值得买瀑布流数据
export const reqPblInfo = (page:any,size:any)=>request({
  url:`https://m.you.163.com/topic/v1/find/recAuto.json?page=${page}&size=${size}`
})

//登录接口
export const reqLogin = (data:any)=>request({
  url:`http://gmall-h5-api.atguigu.cn/api/user/passport/login`,
  data,
  method: "post"
})

//搜索页数据
export const reqSearch = ()=>request({
  url:`https://m.you.163.com/xhr/search/init.json`
})

//实时关键字列表
export const reqKeyword = (data:any)=>request({
  url: `https://m.you.163.com/xhr/search/searchAutoComplete.json`,
  data,
})

//搜索结果展示
export const reqSearchResult = (keyword:any)=>request({
  url: `https://m.you.163.com/xhr/search/search.json?__timestamp=1630133434953&needPopWindow=true&searchWordSource=7&stillSearch=false&_stat_search=autoComplete&itemId=0&size=40&upperPrice=-1&floorPrice=-1&matchType=0&categoryId=0&descSorted=false&sortType=0&keyword=${keyword}`
})